import Layout from '@/components/layout/index'
import NoFound from '@/pages/404'
import RoleList from '@/pages/auth/roleList'
import Auth from '@/pages/auth/index'
import Order from '@/pages/order/index'
import TeamList from '@/pages/auth/teamList'
import UserList from '@/pages/auth/userList'
import Operation from '@/pages/operation/index'
import BusinessTypeList from '@/pages/operation/businessTypeList'
import ComboList from '@/pages/operation/comboList'
import GiftList from '@/pages/operation/giftList'
import Analysis from '@/pages/analysis'
import AnalysisCount from '@/pages/analysis/count'
import AnalysisDo from '@/pages/analysis/analysis'
import OssFile from '@/pages/ossFile'
import OrderList from '@/pages/order/orderList'
import Login from '@/pages/login/index'
import Private from '@/components/private/index'
import GlobalConfig from '@/pages/auth/global-config/index'
import type { MyRouteObject } from './routerType'
import { AccountBookOutlined, LineChartOutlined, CopyOutlined, ProfileOutlined, SettingOutlined } from '@ant-design/icons'
import { Navigate } from 'react-router-dom'

const routeConfig: MyRouteObject[] = [
  {
    path: '/',
    element: <Private><Layout /></Private>,
    children: [
      {
        path: 'home',
        title: '首页',
        element: <Navigate to="/order/order-list" replace />
      },
      {
        path: 'order',
        element: <Order/>,
        icon: <ProfileOutlined />,
        title: '订单管理',
        inMenu: true,
        children: [{
          path: 'order-list',
          title: '订单列表',
          element: <OrderList key="order-list"/>,
          inMenu: true
        }, {
          path: 'invite-list',
          title: '邀约订单',
          element: <OrderList key="invite-list"/>,
          inMenu: true
        }, {
          path: 'seat-order',
          title: '坐席订单',
          element: <OrderList key="seat-order"/>,
          inMenu: true
        }, {
          path: 'intentional-order',
          title: '意向订单',
          element: <OrderList key="intentional-order"/>,
          inMenu: true
        }, {
          path: 'recycling-order',
          title: '回收订单',
          element: <OrderList key="recycling-order"/>,
          inMenu: true
        }, {
          path: 'confirmation-order',
          title: '待确认订单',
          element: <OrderList key="confirmation-order"/>,
          inMenu: true
        }]
      },{
        path: 'operation',
        element: <Operation/>,
        icon: <AccountBookOutlined />,
        title: '运营管理',
        inMenu: true,
        children: [{
          path: 'business-list',
          title: '业务类型',
          element: <BusinessTypeList />,
          inMenu: true
        }, {
          path: 'combo-list',
          title: '套餐管理',
          element: <ComboList />,
          inMenu: true
        }, {
          path: 'gift-list',
          title: '礼品管理',
          element: <GiftList />,
          inMenu: true
        }
          // , {
          //   path: 'notice-list',
          //   title: '平台公告',
          //   element: <NoticeList />,
          //   inMenu: true
          // }
        ]
      },
      {
        path: 'analysis',
        element: <Analysis/>,
        icon: <LineChartOutlined />,
        title: '统计分析',
        inMenu: true,
        children: [{
          path: 'data-count',
          title: '数据统计',
          element: <AnalysisCount/>,
          inMenu: true
        }, {
          path: 'data-analysis',
          title: '数据分析',
          element: <AnalysisDo/>,
          inMenu: true
        }]
      },
      {
        path: 'ossfile',
        element: <OssFile/>,
        icon: <CopyOutlined />,
        title: '文件管理',
        inMenu: true
      },
      {
        path: 'auth',
        element: <Auth/>,
        icon: <SettingOutlined />,
        title: '系统设置',
        inMenu: true,
        children: [{
          path: 'global-config',
          title: '全局配置',
          element: <GlobalConfig/>,
          inMenu: true
        }, {
          path: 'role-list',
          title: '角色管理',
          element: <RoleList/>,
          inMenu: true
        }, {
          path: 'team-list',
          title: '团队管理',
          element: <TeamList/>,
          inMenu: true
        }, {
          path: 'user-list',
          title: '用户管理',
          element: <UserList/>,
          inMenu: true
        }]
      }
    ]
  },
  {
    path: '/login',
    element: <Login />
  },
  {
    path: '*',
    element: <NoFound />
  }
]

export default routeConfig

